package com.dk.service.impl;

import com.dk.mapper.TPersonMapper;
import com.dk.pojo.TPerson;
import com.dk.pojo.TPersonExample;
import com.dk.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description
 * @ClassName PersonServiceImpl
 * @Author RC
 * @date 2020.12.07 19:31
 */
@Service
public class PersonServiceImpl implements PersonService {
    @Autowired
    private TPersonMapper tPersonMapper;
    @Override
    public TPerson findUserByUserName(String username) {
        TPersonExample example = new TPersonExample();
        TPersonExample.Criteria criteria = example.createCriteria();
        criteria.andPnameEqualTo(username);
        List<TPerson> list = tPersonMapper.selectByExample(example);
        return list == null || list.size() == 0 ? null : list.get(0);
    }
}
